var SluggishnessMaterialInfo = function (material) {
  BaseModel.call(this);
  var self = this;

  var fn = {
    initData: function (material) {
      var fields = ['materialCode', 'materialName', 'model', 'providerName', 'color', 'unit', 'providerNo', 'count',
        'safetyStockMin', 'safetyStockMax'
      ];
      self.setDataFromObj(material, fields);

      var dayCount = material.type;
      self.dayCount = dayCount;

      var dayType;
      if (dayCount >= 365) {
        dayType = 3;
      } else if (dayCount >= 182) {
        dayType = 2;
      } else if (dayCount >= 90) {
        dayType = 1;
      } else {
        dayType = '';
      }
      self.dayType = dayType;
    }
  };

  fn.initData(material);
};
